﻿Imports BUS
Imports DTO
Public Class frmBaoCaoThongKeDocGiaNoTienPhat : Inherits DevComponents.DotNetBar.Office2007Form


    Private m_nhanvien As CNhanVienDTO
    Public Property NhanVien() As CNhanVienDTO
        Get
            Return m_nhanvien
        End Get
        Set(ByVal value As CNhanVienDTO)
            m_nhanvien = value
        End Set
    End Property

    Public Function ConvertFromListToDataSet(ByVal ldocgia As List(Of CDocGiaDTO)) As DataTable
        Dim tb As New DataTable()
        tb.Columns.Add("TenDocGia", Type.GetType("System.String"))
        tb.Columns.Add("TienNo", Type.GetType("System.Int32"))
        Dim newrow As DataRow
        For Each item As CDocGiaDTO In ldocgia
            newrow = tb.NewRow()
            newrow("TenDocGia") = item.HoTen
            newrow("TienNo") = item.TongNo
            tb.Rows.Add(newrow)
        Next
        Return tb
    End Function


    Private Sub frmBaoCaoThongKeDocGia_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim view As New rptBaoCaoThongKeDocGiaNoTienPhat()
        view.SetDataSource(ConvertFromListToDataSet(New CDocGiaBUS().DanhSachDocGiaNoTienPhat()))
        view.SetParameterValue("NguoiLap", m_nhanvien.HoTen)
        CrystalReportViewer1.ReportSource = view
        CrystalReportViewer1.Refresh()

    End Sub
End Class